<extend name="Base/common"/>
<block name="style">
   <style type="text/css">
 
   .top{
        width: 100%;
        height: 15%;
        /*background: #cc9;*/

   }
   .top img{
        display: block;
        width: 60px;
        height: 60px;
        border-radius: 50%;
        background: #fff;
        margin: auto;
        margin-top: 5%;
        
   }
   .top p{
        margin:auto;
        font-size: 12px;
        text-align: center;
        margin-top:3%;
        letter-spacing:0;
        color:#898989;
    }
 
p{
        width: 90%;
        height: 45px;
        margin-left: 5%;
        margin-top:10px; 

    }
    p span{
        width: 25%;
        height: 45px;
        background: #EDEDED;
        border:1px solid #ccc;
        border-right: none;
        line-height: 45px;
        text-align: center;
        float: left;
    }
    p input{
        width: 65%;
        height: 45px;
        line-height: 45px;
        background: #fff;
        float: left;
        border:1px solid #ccc;
    }
    p select{
        width: 50%;
        height: 45px;
        background: #fff;
        float: left;
        border:1px solid #ccc;
    }
    p button{
        width: 25%;
        height: 45px;
        background: #EDEDED;
        border:1px solid #ccc;

        border-left: none;
        float: left;
    }

     label{
        display: block;
        height:33px;
        margin-top: 5px;
    }
    label input{
        /*width:65%;*/
        float: right;
        margin-bottom:5%;
    }
    label img{
        width:90%;
        height:40%;
        border-radius: 3px 3px;
        border:1px dashed #999;
        margin-top: -20px;
    }







</style>
</block>
<block name="body">
    <div>
            <div class="top">
                <p><font style="color:#009fe8">{$shop_name}</font>申诉</p>
                
            </div>
            
           
        <notempty name="ts">
            <form action="{:U('shensu')}" method="post" style="height:40%;margin-top:-3%" enctype="multipart/form-data">
                <input type="hidden" name="shop_name" value="{$shop_name}">
                <input type="hidden" name="uid" value="{$one.uid}">
                <foreach name="ts" item="vo">
                   <div style="width:100%;height:45%;">
                       <p>
                            <span>投诉单号{$key+1}</span>
                            <input  name="{$key+1}[trade_no]"  value="{$vo.trade_no}" readonly="readonly"  style="width:65%;padding:7px 10px;border:1px solid #ccc;margin-right:10px;"/>
                        </p>
                        <p>
                            <span>订单金额{$key+1}</span>
                            <input  name="{$key+1}[money]" value="{$vo.money}" readonly="readonly" style="width:65%;padding:7px 10px;border:1px solid #ccc;margin-right:10px;"/>
                        </p>
                        <p>
                            <span>付款账号{$key+1}</span>
                            <input  name="{$key+1}[account]" value="{$vo.account}" readonly="readonly" style="width:65%;padding:7px 10px;border:1px solid #ccc;margin-right:10px;"/>
                        </p>
                        <p>
                            <span>处理方法{$key+1}</span>
                            <input  name="{$key+1}[method]"  style="width:65%;padding:7px 10px;border:1px solid #ccc;margin-right:10px;"/>
                        </p>
                        
                        
                        <label style="height:35%;width:80%;margin-left:5%;margin-bottom:5%">
                            <font style="diaplay:block;font:14px;">处理详情图{$key+1}</font>
                            <div class="up">
                                <input name="file" class='file' accept="image/*" type="file" id="file{$key+1}" style="float:left">
                                <img src="__IMG__/koubei/pic.png" class="img" style="display:block;width:90%;height:40%;">

                                <input name="{$key+1}[pic]" type="hidden" value="">          
                            </div>
                        </label>
                   </div>
                        

            
                        
                </foreach>

                <div class="top" style="margin-top:8%;margin-bottom:3%;">
                    <p style="margin-top:0;text-align:left;">
                        请填写对应投诉订单处理方法及上传一张处理图作为佐证。
                    </p>
                </div>

                <button type="submit" class='login-btn'  style="background:#009fe8;width:85%;margin-left:7.5%;">提交</button>
                
                <!-- <button type="button" class='login-btn'  style="background:#009fe8;width:85%;margin-left:7.5%;">确认</button> -->
            </form>
            <else/>
                <div class="top" style="margin-top:8%;margin-bottom:3%;">
                    <p style="margin-top:0;text-align:left;">
                        您的申诉已处于审核状态，请耐心等候。
                    </p>
                </div>

        </notempty>
            

            


    </div>
</block>
<block name="script">
   <script type="text/javascript">

    var id='';
    $('.file').click(function(){
        id=$(this).attr('id');
    })


        $('.up').change(function(){
                var _this=$(this)
                // var id=_this.
                var formData = new FormData();
                formData.append("file", document.getElementById(id).files[0]); 
                
                // alert(formData)  
                $.ajax({
                    url: "{:U('up')}&type=2",
                    type: "POST",
                    data: formData,
                    /**
                    *必须false才会自动加上正确的Content-Type
                    */
                    contentType: false,
                    /**
                    * 必须false才会避开jQuery对 formdata 的默认处理
                    * XMLHttpRequest会对 formdata 进行正确的处理
                    */
                    processData: false,
                    success: function (data) {
                       
                        if(data==''){

                        }else{
                            _this.find('.img').attr('src','');
                            _this.find('.img').attr('src','Uploads/'+data);

                            _this.find('.img').next().attr('value',data);
                            // $(this).find('.img').show();
                        }
                        
                        
                    },
                });
           
        

        })

   </script>

</block>